#pragma once


class LineFile;

class NagiosItem
{
public:
	char * mName;
	char * mValue;
	char * mComment;
	int mLine;
	NagiosItem * mNext;
public:
	NagiosItem();
	virtual ~NagiosItem();

	int SetValue(char * value);
	int Parse(LineFile * in);
	void Output(FILE * out);
};


class NagiosObject
{
	NagiosItem mType;

	NagiosObject * mNext;
	int mPure;
protected:
	int IsIDItem(const char * name);

public:
	NagiosObject();
	virtual ~NagiosObject(void);

	const char * GetType(){ return mType.mValue; }
	const char * GetID();	
    
	NagiosObject * Next() { return mNext; }
	void SetNext(NagiosObject * n) { mNext = n; }

	int IsPure() { return mPure; }
	void SetPure() { mPure = 1; }

	const char * GetValue(char * name);
	int SetValue(char * name,char * value,int bMode);    

	int RemoveItem(char * name);

	int Parse(LineFile * in);
	void Output(FILE * out);
};
